package com.jet.chat.message;

import java.io.IOException;
import java.io.ObjectInputStream;

import com.jet.chat.exception.ChatException;

public class MessageReaderObjectInputStream implements MessageReader {
	
	ObjectInputStream reader;
	
	public MessageReaderObjectInputStream(ObjectInputStream reader) {
		this.reader = reader;
	}

	@Override
	public Message read() throws ChatException {
		try {
			return (Message) reader.readObject();
		} catch (IOException e) {
			//throw new ChatException(e);
			//throw new ChatException("throw new MessageReaderObjectInputStream IOException");
		} catch (ClassNotFoundException e) {
			//throw new RuntimeException(e);
			//throw new ChatException("throw new MessageReaderObjectInputStream ClassNotFoundException");
		}
		return null;
	}

}
